1. Field of the Invention
The present invention relates generally to processing file system service requests in a computer having an attached disk drive. More particularly, the invention relates to a method for processing such requests in a system where the disk drive, in response to commands from the computer, can write data to and/or read data from disk locations to reproduce stream data and non-stream data.
2. Background Information
A computer having an attached disk drive, such as a magnetic hard disk drive, employs a number of different types of computer programs that cooperate in processes involving accesses to the disk drive. These types include application programs s as word processor or spreadsheet programs, operating systems such as DOS, WINDOWS, UNIX, or Linux and device drivers. A chain of events leading to the writing of data to, or the reading of data from, a disk drive starts with an application program making a function call for a read/write action, and then issuing a file system service request to the operating system.
A typical operating system handles input/output (I/O) requests for stream data using the same procedure associated with I/O requests for non-stream data. Stream data can represent items of a temporal nature such as audio visual (A/V) data or musical data. Stream data can also represent other inherently linear sequential data structures. An inherently linear data structure is one which requires sequential access by its nature; that is, the data structure cannot be reasonably processed or reconstructed if accessed in a non-sequential order. This is in contrast to non-stream data which can be accessed randomly for processing or reconstruction with no inherent access order dependency.
More recently, proposals have been developed to accommodate the handling of I/O requests for stream data differently than the manner by which I/O requests for non-stream data are handled. For example, a document identified as xe2x80x9cT13/D99128 revision 0xe2x80x9d entitled xe2x80x9cProposal For Audio/Visual Feature Setxe2x80x9d available from Western Digital Corporation of Irvine, California and a document identified as xe2x80x9cT13D99123 revision 1xe2x80x9d entitled xe2x80x9cProposal For Streaming AV Commandsxe2x80x9d available from Seagate Technology of Longmont, Colo., describe proposals for handling the storage of stream and non-stream data. These proposals describe using multiple modes of operation, whereby a disk drive is placed into one mode or configuration for I/O of stream data, and into another mode or configuration for I/O of non-stream data.
In contrast to conventional I/O commands used to cause data transfers involving read or write actions, set configuration commands cause a change of operating mode to affect the way that later I/O commands are performed until a subsequent reconfiguration command is generated. In the proposals for handling I/O of stream and non-stream data, set configuration commands are used to place a disk drive into a non-stream mode of operation or into a stream mode of operation. Before a read/write operation can be executed, the host operating system causes the drive to operate in the appropriate mode for either a stream operation or a non-stream operation.
Requests associated with reading/writing non-stream data are handled using a drive mode that results in the data being stored on the disk drive in conventional fashion, without observing any specified rate at which the data is written to or read from memory. For example, an application program request to load application software (such as a spreadsheet program) into a disk drive involves writing non-stream, asynchronous data, which has no associated temporal requirements. This write operation can be executed between the host computer and the disk drive without satisfying any specified data rate constraint.
In contrast, application program requests which involve stream data are executed using a drive mode which ensures that associated temporal requirements of the data will be honored when the stream data is written to or read from the disk drive. The I/O requests between the host computer and the disk drive which are associated with a particular data stream occur consecutively, at regular intervals, so that the continuity of the stream can be preserved. The data is stored on the disk using a mode of operation which will ensure that the data rate constraint can be honored during subsequent reading of the data.
The use of different disk drive configurations, or modes, for stream data versus non-stream data, is due to an assumption that disk drives cannot freely mix streaming and non-streaming operations. However, mode switching is inefficient and may require processing in the disk drive which impacts performance.
Accordingly, it would be desirable to develop a method for processing file system service requests which involve non-stream data and stream data, wherein the use of set mode configuration commands can be avoided. In so doing, it would be desirable if the method could be easily integrated with conventional operating systems so that requests for both non-stream and stream data between a host computer and an attached disk drive can be executed without modification to existing file systems.
This invention is directed to a method and apparatus for processing file system service requests in a computer having an attached disk drive that in response to commands from the computer can write data to or read data from disk locations to reproduce stream data and non-stream data. The method comprises the steps of responding to a first file system service request by recording whether the first file system service request is for non-stream data or stream data, associating a first set of disk locations of the disk drive with the first file system service request, and preparing a first command that requires access to the first set of disk locations, the first command including control data categorizing the command as a non-stream access command or as a stream access command in response to the step of recording. The method also includes transmitting the first command to the disk drive.
An exemplary apparatus includes means for responding to the first file system service request in accordance with the foregoing method, and means for transmitting the first command to the disk drive.
The invention provides for responding to file system service requests for stream data or for non-stream data without a need for set mode configuration commands. For example, if the first file system service request is for non-stream data, and that the first command is a non-stream access command, the method also comprises responding to a second file system service request for stream data. The method includes recording that the second file system service request is for stream data, associating a second set of disk locations of the disk drive with the second file system service request, and preparing a second command that requires access to the second set of disk locations, the second command including control data categorizing the command as a stream access command. The method includes transmitting the second command to the disk drive.
In exemplary embodiments, the first and second file system service requests can be received and responded to in any order. For example, the second file system service request may be received before the first file system service request. Similarly, the first and second commands can be prepared and/or transmitted in any order, regardless of the order to which the first and second file system service requests are responded.
In exemplary embodiments, the step of associating can be performed in response to an application file system service request which specifies parameters that identify the file system service requests as a stream request. A feature of the invention involves using an application program interface (API) configured, for example, as an operating system extension, or xe2x80x9cshimxe2x80x9d. The shim can be configured to intercept file system service requests identified as stream requests. Alternately, to accommodate legacy applications, the step of responding to a file system service request can include intercepting the file system service request, and determining whether the file system service request is for stream data or non-stream data. The steps of intercepting and determining can be performed by any selected API including the shim.
The shim can be configured to respond to file system service requests by updating a file allocation structure of the operating system (such as a file allocation table), and by recording whether the request is for stream data or for non-stream data. In embodiments where the shim intercepts all file system service requests, it can also record whether the request is for non-stream data. A record can be created as a single data structure accessed by a disk device driver to issue stream access commands or non-stream access commands to the disk drive. Of course, the record can be maintained in any desired location, and need not be included in the shim. The disk device driver can issue stream access commands using, for example, a stream pointer and the number of logical blocks included in the stream.
In exemplary embodiments, a conventional disk drive can be used. In alternate embodiments, the addressable locations of the disk drive can be mapped from a logical space of the file system into a physical space of the disk drive using a linked list. The mapping can be performed within the disk drive using logical block addresses obtained from the file system using contents of the record.